/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-04-20
 * Time: 16:32
 */
public class TestDemo {
    /**
     *
     * @param args 偏移量处添加
     */
    public static void main(String[] args) {
        String str="Hello";
        StringBuffer stringBuffer = new StringBuffer(str);
        stringBuffer.insert(5,"beijing");
        System.out.println(stringBuffer);
    }
    /**
     *
     * @param args  append  追加字符串
     */
    public static void main5(String[] args) {
        String str="Hello";
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(str).append(" ").append("Beijing");
        System.out.println(stringBuffer);

    }
    /**
     *
     * @param args  reverse 字符逆序
     */
    public static void main3(String[] args) {
        String str="Hello World";
        StringBuffer stringbuffer = new StringBuffer(str);
        stringbuffer.reverse();
        System.out.println(stringbuffer);
    }
    public static void main2(String[] args) {
        String str = "abcd";
        StringBuilder stringbuffer = new StringBuilder();
        stringbuffer.append(str).append("eeee");
        System.out.println(str);
        System.out.println(stringbuffer);
    }
        String str = new String("good");
        char[ ] ch = { 'a' , 'b' , 'c' };
        public static void main1(String args[]){
            TestDemo ex = new TestDemo();
            ex.change(ex.str,ex.ch);
            System.out.print(ex.str + " and ");
            System.out.print(ex.ch);
        }
        public void change(String str,char ch[ ]){
            str = "test ok";
            ch[0] = 'g';
        }

}